package com.yusong.open.sdk.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * Created by yusong on 2018/1/24.
 * 消息序列号生成器
 */
public class SerialNumberUtil {

    private static final Random randomSeed = new Random();

    /*
    *生成消息序列号
    */
    public static String generateSerialNumber(){
        DateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmssSSS");
        Date now = new Date();
        Integer random = randomSeed.nextInt(1000);
        return sdf.format(now) + random;
    }


}
